<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateAgentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('agents', function (Blueprint $table) {
            $table->id();
            $table->string("name", 40)->comment("客户名称");
            $table->tinyInteger("agent_level_id")->default(1)->comment("1=一级代理2=二级代理");
            $table->integer("mob")->comment("手机");
            $table->string("realname", 20)->comment("姓名");
            $table->string("province",100)->comment("省");
            $table->string("city",100)->comment("市");
            $table->string("country",100)->comment("县");
            $table->tinyText("address")->comment("地址");
            $table->unsignedInteger("cash")->default(0)->comment("余额");
            $table->tinyInteger("status")->default(1)->comment("1=正常2=冻结");
            $table->string("username", 20)->comment("代理登录账号");
            $table->string("password")->comment("login passs");
            $table->integer("created_at");
            $table->integer("updated_at");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('agents');
    }
}
